package com.citytransport.prokopjuk.builder_strategy;

import java.util.ArrayList;
import com.citytransport.prokopjuk.route.Station;
import com.citytransport.prokopjuk.vehicleDTO.*;


/**
 * Class RouteBuilder extends AbstractMethodError and implements abstract
 * methods. This class realize methods to build {@link Route} with object of route's attribute,
 * that gives to {@link SimpleRouteBuilder} constructor.    
 * */
public class SimpleRouteBuilder extends AbstractRouteBuilder {
    
	private ArrayList<? extends Vehicle> vehicles;
	private ArrayList<Station> stations;
	private int price;
	private int intervalMinute;
	private int routeID;
	
	public SimpleRouteBuilder(ArrayList<? extends Vehicle> vehicles,ArrayList<Station> stations,int price,
		int intervalMinute,int routeID){
	    this.vehicles = new ArrayList(vehicles);
	    this.stations = new ArrayList<Station>(stations);
	    this.price = price;
	    this.intervalMinute = intervalMinute;
	    this.routeID = routeID;	    
	}
	/**
	 * Delegate method setIntervalMinute to object of Route.
	 * */
	@Override
	public void setIntervalMinute() {
	    route.setIntervalMinute(intervalMinute);
	}

	/**
	 * Delegate method setRouteID to object route.
	 * */
	@Override
	public void setRouteID() {
	    route.setRouteID(routeID);
	}

	/**
	 * Delegate method setVehicleOnRoute to object route.
	 * */
	@Override
	public void setVehicleOnRoute( ) {
	    route.setVehicleOnRoute(vehicles);
	}
	
	/**
	 * Delegate method setPrice to object route.
	 * */
	@Override
	public void setPrice() {
	    route.setPrice(price);
	}
	
	/**
	 * Delegate method setStations to object route.
	 * */
	@Override
	public void setStations() {
	    route.setStations(stations);	    
	}

}
